# -*- coding: utf-8 -*-
import os.path
from functools import partial

################################################################################
## Form generated from reading UI file '爬虫界面.ui'
##
## Created by: Qt User Interface Compiler version 6.9.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################

from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
    QMetaObject, QObject, QPoint, QRect,
    QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
    QFont, QFontDatabase, QGradient, QIcon,
    QImage, QKeySequence, QLinearGradient, QPainter,
    QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QFrame, QHBoxLayout, QLabel,
    QLineEdit, QMainWindow, QProgressBar, QPushButton,
    QScrollArea, QSizePolicy, QStackedWidget, QStatusBar,
    QVBoxLayout, QWidget)

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        if not MainWindow.objectName():
            MainWindow.setObjectName(u"MainWindow")
        MainWindow.resize(1089, 603)
        self.centralwidget = QWidget(MainWindow)
        self.centralwidget.setObjectName(u"centralwidget")
        self.horizontalLayout = QHBoxLayout(self.centralwidget)
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.widget = QWidget(self.centralwidget)
        self.widget.setObjectName(u"widget")
        self.widget.setMinimumSize(QSize(150, 0))
        self.verticalLayout = QVBoxLayout(self.widget)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.pushButton = QPushButton(self.widget)
        self.pushButton.setObjectName(u"pushButton")
        self.pushButton.setMinimumSize(QSize(100, 40))

        self.verticalLayout.addWidget(self.pushButton)

        self.pushButton_2 = QPushButton(self.widget)
        self.pushButton_2.setObjectName(u"pushButton_2")
        self.pushButton_2.setMinimumSize(QSize(0, 40))

        self.verticalLayout.addWidget(self.pushButton_2)

        self.pushButton_3 = QPushButton(self.widget)
        self.pushButton_3.setObjectName(u"pushButton_3")
        self.pushButton_3.setMinimumSize(QSize(0, 40))

        self.verticalLayout.addWidget(self.pushButton_3)

        self.pushButton_4 = QPushButton(self.widget)
        self.pushButton_4.setObjectName(u"pushButton_4")
        self.pushButton_4.setMinimumSize(QSize(0, 40))

        self.verticalLayout.addWidget(self.pushButton_4)


        self.horizontalLayout.addWidget(self.widget)

        self.line = QFrame(self.centralwidget)
        self.line.setObjectName(u"line")
        self.line.setFrameShape(QFrame.Shape.VLine)
        self.line.setFrameShadow(QFrame.Shadow.Sunken)

        self.horizontalLayout.addWidget(self.line)

        self.stackedWidget = QStackedWidget(self.centralwidget)
        self.stackedWidget.setObjectName(u"stackedWidget")
        self.page = QWidget()
        self.page.setObjectName(u"page")
        self.pushButton_5 = QPushButton(self.page)
        self.pushButton_5.setObjectName(u"pushButton_5")
        self.pushButton_5.setGeometry(QRect(550, 450, 291, 71))
        self.label = QLabel(self.page)
        self.label.setObjectName(u"label")
        self.label.setGeometry(QRect(120, 30, 251, 61))
        font = QFont()
        font.setFamilies([u"\u5b8b\u4f53"])
        font.setPointSize(34)
        font.setBold(True)
        font.setItalic(True)
        self.label.setFont(font)
        self.label_2 = QLabel(self.page)
        self.label_2.setObjectName(u"label_2")
        self.label_2.setGeometry(QRect(130, 170, 611, 141))
        font1 = QFont()
        font1.setFamilies([u"\u5b8b\u4f53"])
        font1.setPointSize(42)
        self.label_2.setFont(font1)
        self.stackedWidget.addWidget(self.page)
        self.page_1 = QWidget()
        self.page_1.setObjectName(u"page_1")
        self.verticalLayout_2 = QVBoxLayout(self.page_1)
        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
        self.widget_2 = QWidget(self.page_1)
        self.widget_2.setObjectName(u"widget_2")
        self.widget_2.setMaximumSize(QSize(888, 70))
        self.widget_2.setSizeIncrement(QSize(0, 0))
        self.widget_2.setBaseSize(QSize(0, 0))
        self.horizontalLayout_2 = QHBoxLayout(self.widget_2)
        self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
        self.lineEdit = QLineEdit(self.widget_2)
        self.lineEdit.setObjectName(u"lineEdit")
        self.lineEdit.setMaximumSize(QSize(750, 30))

        self.horizontalLayout_2.addWidget(self.lineEdit)

        self.pushButton_6 = QPushButton(self.widget_2)
        self.pushButton_6.setObjectName(u"pushButton_6")
        self.pushButton_6.setMaximumSize(QSize(16777215, 30))

        self.horizontalLayout_2.addWidget(self.pushButton_6)


        self.verticalLayout_2.addWidget(self.widget_2)

        self.progressBar = QProgressBar(self.page_1)
        self.progressBar.setObjectName(u"progressBar")
        self.progressBar.setValue(24)

        self.verticalLayout_2.addWidget(self.progressBar)

        self.line_2 = QFrame(self.page_1)
        self.line_2.setObjectName(u"line_2")
        self.line_2.setFrameShape(QFrame.Shape.HLine)
        self.line_2.setFrameShadow(QFrame.Shadow.Sunken)

        self.verticalLayout_2.addWidget(self.line_2)

        self.widget_3 = QWidget(self.page_1)
        self.widget_3.setObjectName(u"widget_3")
        self.verticalLayout_4 = QVBoxLayout(self.widget_3)
        self.verticalLayout_4.setObjectName(u"verticalLayout_4")
        self.widget_6 = QWidget(self.widget_3)
        self.widget_6.setObjectName(u"widget_6")
        self.scrollArea = QScrollArea(self.widget_6)
        self.scrollArea.setObjectName(u"scrollArea")
        self.scrollArea.setGeometry(QRect(0, -10, 871, 371))
        self.scrollArea.setWidgetResizable(True)
        self.scrollAreaWidgetContents = QWidget()
        self.scrollAreaWidgetContents.setObjectName(u"scrollAreaWidgetContents")
        self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 869, 369))
        self.scrollArea.setWidget(self.scrollAreaWidgetContents)

        self.verticalLayout_4.addWidget(self.widget_6)

        self.widget_7 = QWidget(self.widget_3)
        self.widget_7.setObjectName(u"widget_7")
        self.widget_7.setMaximumSize(QSize(16777215, 50))
        self.horizontalLayout_3 = QHBoxLayout(self.widget_7)
        self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
        self.pushButton_7 = QPushButton(self.widget_7)
        self.pushButton_7.setObjectName(u"pushButton_7")

        self.horizontalLayout_3.addWidget(self.pushButton_7)

        self.label_4 = QLabel(self.widget_7)
        self.label_4.setObjectName(u"label_4")

        self.horizontalLayout_3.addWidget(self.label_4)

        self.pushButton_8 = QPushButton(self.widget_7)
        self.pushButton_8.setObjectName(u"pushButton_8")

        self.horizontalLayout_3.addWidget(self.pushButton_8)


        self.verticalLayout_4.addWidget(self.widget_7)


        self.verticalLayout_2.addWidget(self.widget_3)

        self.stackedWidget.addWidget(self.page_1)
        self.page_2 = QWidget()
        self.page_2.setObjectName(u"page_2")
        self.verticalLayout_3 = QVBoxLayout(self.page_2)
        self.verticalLayout_3.setObjectName(u"verticalLayout_3")
        self.widget_4 = QWidget(self.page_2)
        self.widget_4.setObjectName(u"widget_4")
        self.widget_4.setMaximumSize(QSize(16777215, 75))
        self.label_3 = QLabel(self.widget_4)
        self.label_3.setObjectName(u"label_3")
        self.label_3.setGeometry(QRect(20, 0, 191, 61))
        font2 = QFont()
        font2.setFamilies([u"\u5b8b\u4f53"])
        font2.setPointSize(22)
        font2.setBold(True)
        self.label_3.setFont(font2)

        self.verticalLayout_3.addWidget(self.widget_4)

        self.widget_5 = QWidget(self.page_2)
        self.widget_5.setObjectName(u"widget_5")

        self.verticalLayout_3.addWidget(self.widget_5)

        self.stackedWidget.addWidget(self.page_2)
        self.page_3 = QWidget()
        self.page_3.setObjectName(u"page_3")
        self.stackedWidget.addWidget(self.page_3)

        self.horizontalLayout.addWidget(self.stackedWidget)

        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QStatusBar(MainWindow)
        self.statusbar.setObjectName(u"statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)

        self.stackedWidget.setCurrentIndex(0)
        # 修改
        self.but_welcome = self.pushButton  # 主页
        self.but_search = self.pushButton_2  # 搜索
        self.but_my = self.pushButton_3  # 我的
        self.but_set = self.pushButton_4  # 配置
        self.but_welcome_2 = self.pushButton_5  # 开始按钮
        # 导航栏切换
        self.but_welcome.clicked.connect(
            partial(self.create_trough, self.but_welcome.objectName())
        )
        self.but_search.clicked.connect(
            partial(self.create_trough, self.but_search.objectName())
        )
        self.but_my.clicked.connect(
            partial(self.create_trough, self.but_my.objectName())
        )
        self.but_set.clicked.connect(
            partial(self.create_trough, self.but_set.objectName())
        )
        self.but_welcome_2.clicked.connect(
            partial(self.create_trough, self.but_welcome_2.objectName())
        )


        QMetaObject.connectSlotsByName(MainWindow)
    # setupUi

    # 页面切换创建槽
    def create_trough(self,name):
        if name == 'pushButton':
            self.stackedWidget.setCurrentIndex(0)

        if name == 'pushButton_2':
            self.stackedWidget.setCurrentIndex(1)

        if name == 'pushButton_3':
            self.stackedWidget.setCurrentIndex(2)

        if name == 'pushButton_4':
            self.stackedWidget.setCurrentIndex(3)

        if name == 'pushButton_5':
            self.stackedWidget.setCurrentIndex(1)

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
        self.pushButton.setText(QCoreApplication.translate("MainWindow", u"\u6b22\u8fce\u4f7f\u7528", None))
        self.pushButton_2.setText(QCoreApplication.translate("MainWindow", u"\u641c\u7d22", None))
        self.pushButton_3.setText(QCoreApplication.translate("MainWindow", u"\u6211\u7684mod", None))
        self.pushButton_4.setText(QCoreApplication.translate("MainWindow", u"\u8bbe\u7f6e", None))
        self.pushButton_5.setText(QCoreApplication.translate("MainWindow", u"\u5f00\u59cb\u4f7f\u7528->", None))
        self.label.setText(QCoreApplication.translate("MainWindow", u"\u6b22\u8fce\u4f7f\u7528", None))
        self.label_2.setText(QCoreApplication.translate("MainWindow", u"\u98ce\u7075\u6708\u5f71\u6e38\u620fMOD\u4e0b\u8f7d\u5668", None))
        self.pushButton_6.setText(QCoreApplication.translate("MainWindow", u"\u641c\u7d22", None))
        self.pushButton_7.setText(QCoreApplication.translate("MainWindow", u"\u4e0a\u4e00\u9875", None))
        self.label_4.setText(QCoreApplication.translate("MainWindow", u"\u9875", None))
        self.pushButton_8.setText(QCoreApplication.translate("MainWindow", u"\u4e0b\u4e00\u9875", None))
        self.label_3.setText(QCoreApplication.translate("MainWindow", u"\u6211\u7684MOD", None))
    # retranslateUi

if __name__ == "__main__":
    img_path = (os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath('GUI')))))
    img_path = os.path.join(img_path,'img','img_data.png')
    print(img_path)

